﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;

namespace PropertyManagment.entity {

    /// <summary>
    /// 角色实体类
    /// </summary>
    [Table("sys_role")]
    public class SysRole : BaseEntity {

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime created { get; set; }
        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime? updated { get; set; }
        /// <summary>
        /// 状态
        /// </summary>
        [Required]
        public int statu { get; set; }

        /// <summary>
        /// 角色名
        /// </summary>
        [Required(ErrorMessage = "角色名称不能为空")]
        public String name { get; set; }

        /// <summary>
        /// 角色编码
        /// </summary>
        [Required(ErrorMessage = "角色编码不能为空")]
        public String code { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public String remark { get; set; }

        /// <summary>
        /// 角色拥有的菜单权限id
        /// </summary>
        public List<long> menuIds = new List<long>();
    }
}
